<!DOCTYPE html>
<html>
<head>
    <title>欧瑞激光</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="欧瑞激光" />
    <meta name="keywords" content="欧瑞激光" />

    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <!-- css -->
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
    <link href="__HOME__css/iconfont.css" rel="stylesheet"/>
    <link href="__HOME__css/am.css" rel="stylesheet"/>
    <link href="__HOME__css/flexslider.css" rel="stylesheet"/>
    <link href="__HOME__css/style.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__HOME__css/blueimp-gallery.min.css">

</head>
<body>

<div class="wrap">
    <!-- page -->
    <div class="_contactus">
        <div class="_form" style="width: 500px;margin: 0 auto;padding-top: 30px;">
            <form id="Contactus_form">
                <input class="_inp_text" type="text" id="name" name="name"  placeholder="姓名 *" autocomplete="off">
                <input class="_inp_text" type="text" id="tel" name="tel"  placeholder="手机号码 *" autocomplete="off">
                <input class="_inp_text" type="text" id="email" name="email"  placeholder="邮箱地址" autocomplete="off">
                <input class="_inp_text" type="text" id="com" name="com"  placeholder="公司名称" autocomplete="off">


               <!--  <textarea class="_inp_text"  type="text" id="content" name="message"  placeholder="Message *" autocomplete="off"></textarea> -->
            </form>
            <a class="_submit" id="subMit" >提交</a>
            <!--<p class="_text">我们按照欧盟通用数据保护条例(GDPR)对待您的数据，想了解更多信息请查看我们的隐私权声明。</p>-->
        </div>
        <input type="hidden" value="{$id}" id="id">
    </div>
    <!-- footer end -->
</div>
<!-- js -->
<script src="__HOME__js/jquery.js"></script>
<script src="__HOME__js/jquery.flexslider.js"></script>
<script type="text/javascript" src="__HOME__js/jquery.waypoints.min.js"></script>
<script src="__HOME__js/jquery.cookie.js"></script>
<script src="__HOME__js/jquery.filterizr.min.js"></script>
<script src="__HOME__js/jquery.blueimp-gallery.min.js"></script>
<script src="__HOME__js/jquery.ellipsis.js"></script>
<script src="__HOME__js/base.js"></script>

<script type="text/javascript">

    $('#subMit').click(function(){
        var email = $('#email').val();
        var tel = $('#tel').val();
        if(!$('#name').val()){
            alert('请输入您的名称!')
            return false;
        }else if(!tel){
            alert('请输入手机号码!')
            return false;
        }
        if(email){
            if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/))
            {
                alert("请输入正确的邮箱地址.");
                return false;
            }
        }
        $.ajax({
            type: "POST",
            dataType: "json",
            url: '/home/danye/addcontactus',
            data: {
                'name':$('#name').val(),
                'com':$('#com').val(),
                'email':$('#email').val(),
                'tel':$('#tel').val(),
                'country':'',
                'content':'',
                'type':2
            },
            success: function (res) {
                var success = JSON.parse(res);
                if(success.code===200){
                    $.ajax({
                        type: "get",
                        dataType: "json",
                        url: '/home/download/getOne/id/'+$('#id').val(),
                        success: function (res) {
                            var success = JSON.parse(res);
                            $.cookie('xiazai', '1', { expires: 7, path: '/' });
                            if(success.code===200){
                                window.open(encodeURI(success.data.zip_url));
                            }
                        }
                    });
                    alert(success.msg);

                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);

                }else {
                    alert(success.msg);
                }

            }
        });

    })
</script>

</body>
</html>